import java.util.Stack;

/**
 * @author gao
 * @date 2025/7/4 10:21
 */

public class Main {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        stack.push(1);// 放入元素
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);

        System.out.println(stack.size());// 栈中元素数目
        System.out.println(stack);
        System.out.println(stack.empty());// 检查栈是否为空
        System.out.println(stack.peek());// 返回栈顶元素
        System.out.println(stack.pop());// 栈顶元素出栈
    }
}